import os
import threading

class SaveInfoForJson(object):

	
	def save_info(self, file_name, info):
		try:
			if os.path.exists('{}.txt'.format(file_name)):
				return
			with open('{}.txt'.format(file_name), 'w', encoding='utf-8') as f:
				f.write('{\n')
				for key in info.keys():
					val = info[key]
					if isinstance(val, list):
						f.write("'{}':[".format(key))
						for v in val:
							f.write("'{}',".format(v))
						f.write("],\n")
					else:
						f.write("'{}':'{}',\n".format(key, val))
				f.write('}')
		except Exception as e:
			print(e)
		